<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* 
* Module default for frontpage
* @author DANG DINH HUNG
*
*/
class Home extends Public_Controller
{
	
	public function __construct()
	{
		parent::__construct();
		$this->load->model('home_m'); 
	}
	
	public function index()
	{
		$this->data->record_array = $this->home_m->index();
	
		$this->template
			->build('index', $this->data);
	}
	
	function js_user(){
		if(isset($_SESSION['user'])){
			$json = json_encode($_SESSION['user']);
		}else{
			$json = json_encode(null);
		}
		header("content-type:application/x-javascript");
		echo "var userObj=".$json.";";
		//echo "var ABC='".time()."';";
	}

}